3.5.52 \(\int \cos ^2(c+d x) (a+b \sec (c+d x)) \, dx\) [452]

Optimal. Leaf size=38 \[ \frac {a x}{2}+\frac {b \sin (c+d x)}{d}+\frac {a \cos (c+d x) \sin (c+d x)}{2 d} \]

[Out]

1/2*a*x+b*sin(d*x+c)/d+1/2*a*cos(d*x+c)*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {3872, 2715, 8, 2717} \begin {gather*} \frac {a \sin (c+d x) \cos (c+d x)}{2 d}+\frac {a x}{2}+\frac {b \sin (c+d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^2*(a + b*Sec[c + d*x]),x]

[Out]

(a*x)/2 + (b*Sin[c + d*x])/d + (a*Cos[c + d*x]*Sin[c + d*x])/(2*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2715

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Sin[c + d*x])^(n - 1)/(d*n))
, x] + Dist[b^2*((n - 1)/n), Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integ
erQ[2*n]

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3872

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rubi steps

\begin {align*} \int \cos ^2(c+d x) (a+b \sec (c+d x)) \, dx &=a \int \cos ^2(c+d x) \, dx+b \int \cos (c+d x) \, dx\\ &=\frac {b \sin (c+d x)}{d}+\frac {a \cos (c+d x) \sin (c+d x)}{2 d}+\frac {1}{2} a \int 1 \, dx\\ &=\frac {a x}{2}+\frac {b \sin (c+d x)}{d}+\frac {a \cos (c+d x) \sin (c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.08, size = 35, normalized size = 0.92 \begin {gather*} \frac {4 b \sin (c+d x)+a (2 (c+d x)+\sin (2 (c+d x)))}{4 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^2*(a + b*Sec[c + d*x]),x]

[Out]

(4*b*Sin[c + d*x] + a*(2*(c + d*x) + Sin[2*(c + d*x)]))/(4*d)

________________________________________________________________________________________

Maple [A]
time = 0.07, size = 38, normalized size = 1.00

method result size
risch \(\frac {a x}{2}+\frac {b \sin \left (d x +c \right )}{d}+\frac {a \sin \left (2 d x +2 c \right )}{4 d}\) \(32\)
derivativedivides \(\frac {a \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+\sin \left (d x +c \right ) b}{d}\) \(38\)
default \(\frac {a \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+\sin \left (d x +c \right ) b}{d}\) \(38\)
norman \(\frac {a x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {\left (a +2 b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {a x}{2}+\frac {a x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-\frac {\left (a -2 b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}\) \(90\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2*(a+b*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(a*(1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c)+sin(d*x+c)*b)

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 34, normalized size = 0.89 \begin {gather*} \frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a + 4 \, b \sin \left (d x + c\right )}{4 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+b*sec(d*x+c)),x, algorithm="maxima")

[Out]

1/4*((2*d*x + 2*c + sin(2*d*x + 2*c))*a + 4*b*sin(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 3.78, size = 29, normalized size = 0.76 \begin {gather*} \frac {a d x + {\left (a \cos \left (d x + c\right ) + 2 \, b\right )} \sin \left (d x + c\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+b*sec(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(a*d*x + (a*cos(d*x + c) + 2*b)*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2*(a+b*sec(d*x+c)),x)

[Out]

Integral((a + b*sec(c + d*x))*cos(c + d*x)**2, x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 82 vs. \(2 (34) = 68\).
time = 0.43, size = 82, normalized size = 2.16 \begin {gather*} \frac {{\left (d x + c\right )} a - \frac {2 \, {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+b*sec(d*x+c)),x, algorithm="giac")

[Out]

1/2*((d*x + c)*a - 2*(a*tan(1/2*d*x + 1/2*c)^3 - 2*b*tan(1/2*d*x + 1/2*c)^3 - a*tan(1/2*d*x + 1/2*c) - 2*b*tan
(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 + 1)^2)/d

________________________________________________________________________________________

Mupad [B]
time = 0.81, size = 31, normalized size = 0.82 \begin {gather*} \frac {a\,x}{2}+\frac {a\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {b\,\sin \left (c+d\,x\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^2*(a + b/cos(c + d*x)),x)

[Out]

(a*x)/2 + (a*sin(2*c + 2*d*x))/(4*d) + (b*sin(c + d*x))/d

________________________________________________________________________________________